package com.ideasmaker.util;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class HibernateSessionUtil {
	
	private static SessionFactory sessionFactory = null;
	
	private static Session session;
	
	static{
		if(sessionFactory == null)
		sessionFactory = new AnnotationConfiguration().configure()
		.buildSessionFactory();
	}

	public static Session getSession() {
		return sessionFactory.openSession();
	}

	public static void setSession(Session session) {
		HibernateSessionUtil.session = session;
	}
	
	
	
	

}
